# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ChromePolicy.V1.Model.GoogleChromePolicyVersionsV1PolicyApiLifecycle do
  @moduledoc """
  Lifecycle information.

  ## Attributes

  *   `deprecatedInFavorOf` (*type:* `list(String.t)`, *default:* `nil`) - In the event that this policy was deprecated in favor of another policy, the fully qualified namespace(s) of the new policies as they will show in PolicyAPI. Could only be set if policy_api_lifecycle_stage is API_DEPRECATED.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Description about current life cycle.
  *   `endSupport` (*type:* `GoogleApi.ChromePolicy.V1.Model.GoogleTypeDate.t`, *default:* `nil`) - End supporting date for current policy. Attempting to modify a policy after its end support date will result in a Bad Request (400 error). Could only be set if policy_api_lifecycle_stage is API_DEPRECATED.
  *   `policyApiLifecycleStage` (*type:* `String.t`, *default:* `nil`) - Indicates current life cycle stage of the policy API.
  *   `scheduledToDeprecatePolicies` (*type:* `list(String.t)`, *default:* `nil`) - Corresponding to deprecated_in_favor_of, the fully qualified namespace(s) of the old policies that will be deprecated because of introduction of this policy.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :deprecatedInFavorOf => list(String.t()) | nil,
          :description => String.t() | nil,
          :endSupport => GoogleApi.ChromePolicy.V1.Model.GoogleTypeDate.t() | nil,
          :policyApiLifecycleStage => String.t() | nil,
          :scheduledToDeprecatePolicies => list(String.t()) | nil
        }

  field(:deprecatedInFavorOf, type: :list)
  field(:description)
  field(:endSupport, as: GoogleApi.ChromePolicy.V1.Model.GoogleTypeDate)
  field(:policyApiLifecycleStage)
  field(:scheduledToDeprecatePolicies, type: :list)
end

defimpl Poison.Decoder,
  for: GoogleApi.ChromePolicy.V1.Model.GoogleChromePolicyVersionsV1PolicyApiLifecycle do
  def decode(value, options) do
    GoogleApi.ChromePolicy.V1.Model.GoogleChromePolicyVersionsV1PolicyApiLifecycle.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.ChromePolicy.V1.Model.GoogleChromePolicyVersionsV1PolicyApiLifecycle do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
